package com.xixibaby.pay;

import com.egzosn.pay.ali.api.AliPayService;
import com.egzosn.pay.wx.api.WxPayConfigStorage;
import com.egzosn.pay.wx.api.WxPayService;
import com.xixibaby.pay.alibaba.AlibabaPay;
import com.xixibaby.pay.alibaba.AlibabaPayConfig;
import com.xixibaby.pay.wechat.WechatMicroPay;
import com.xixibaby.pay.wechat.WechatPay;
import com.xixibaby.pay.wechat.WechatPayConfig;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author tooomj
 *
 */
@Configuration
@EnableConfigurationProperties({AlibabaPayConfig.class,WechatPayConfig.class})
public class XixibabyPayAutoConfiguration {

    @Bean
    public AliPayService payConfigPayService(AlibabaPayConfig config){
        return new AliPayService(config);
    }

    @Bean
    public WxPayService wxPayService(WechatPayConfig config){
        return new WxPayService(config);
    }
    @Bean
    public PayAdapt payAdapt(){
        return new PayAdapt();
    }

    @Bean
    public AlibabaPay alibabaPay(){
        return new AlibabaPay();
    }

    @Bean
    public WechatPay wechatPay(){
        return new WechatPay();
    }

    @Bean
    public WechatMicroPay wechatMicroPay(){
        return new WechatMicroPay();
    }


}
